[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Copy                     Returns Substring from String

 Copy(Source : <string>; Start,NumChars : Integer) : <string>;           [TP]

    Returns a string copied from Source starting at location Start and
    consisting of NumChars characters.

          Source    Any string value (constant, variable, function call or
                    expression).

           Start    An integer value; starting location in Source for
                    substring; should be in the range 1..Length(Source).

        NumChars    An integer value; number of characters to be copied;
                    should be in the range 1..(1+Length(Source)-Start)

          Notes:    If Start is not in the range 1..255, a runtime error
                    17 ($11) is generated.

                    If Start is greater than the length of the string, the
                    empty string is returned.

 -------------------------------- Example ---------------------------------

           Name := 'Rufus P. Jones';
           First := Copy(Name,1,5);         { get first name }
           Middle := Copy(Name,7,2);        { get middle initial }
           Last := Copy(Name,10,5);         { get last name }

See Also: Delete Insert Concat
This page created by ng2html v1.05, the Norton guide to HTML conversion utility. Written by Dave Pearson